home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CommToolbox (modified) / Sources / CCTBSwitchboard.cp < prev    next >
Encoding:
Text File  |  1994-11-30  |  1.8 KB  |  91 lines  |  [TEXT/KAHL]

  1. /* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  2.  
  3.     CCTBSwitchboard.c
  4.     
  5.     CommToolbox compatible switchboard.
  6.     
  7.     SUPERCLASS = CSwitchboard.
  8.     
  9.     Copyright © 1992-93 Romain Vignes. All rights reserved.
  10.     modified Ithran Einhorn 1994
  11.     
  12. ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ */
  13.  
  14. #include <CApplication.h>                        /* TCL includes */
  15. #include <CDesktop.h>
  16. #include <Constants.h>
  17. #include <Global.h>
  18.  
  19. #include "CCTBApp.h"                            /* Other includes */
  20. #include "CCTBSwitchboard.h"
  21. #include "CFileTransfer.h"
  22. #include "CTermPane.h"
  23.  
  24.  
  25. /* Application globals */
  26.  
  27. extern CApplication    *gApplication;
  28. extern CDesktop        *gDesktop;
  29.  
  30.  
  31. /*
  32.  * ICTBSwitchboard
  33.  *
  34.  * Switchboard object initialisation
  35.  *
  36.  */
  37.  
  38. void CCTBSwitchboard::ICTBSwitchboard(void)
  39. {
  40.     CSwitchboard::ISwitchboard();            /* Initialize superclass */
  41. }
  42.  
  43.  
  44. /* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ */
  45.  
  46. /*
  47.  * DispatchEvent
  48.  *
  49.  * Events dispatching
  50.  *
  51.  * macEvent:    Pointer on the event record
  52.  *
  53.  */
  54.  
  55. void CCTBSwitchboard::DispatchEvent(EventRecord *macEvent)
  56. {
  57.     WindowPtr        theWindow;
  58.     Boolean            toolEvent;
  59.     
  60.     toolEvent = FALSE;
  61.     theWindow = NULL;
  62.     
  63.     switch (macEvent->what)    {    
  64.                                 
  65.         case mouseDown:
  66.             FindWindow(macEvent->where,&theWindow);
  67.             break;
  68.             
  69.         case activateEvt:
  70.         case updateEvt:
  71.             theWindow = (WindowPtr) macEvent->message;
  72.             break;
  73.     }
  74.     
  75.     if (theWindow != NULL)    {
  76.     
  77.         toolEvent = CFileTransfer::cTestToolEvent(macEvent,theWindow);
  78.         
  79.         if (!toolEvent)
  80.             toolEvent = CConnection::cTestToolEvent(macEvent,theWindow);
  81.             
  82.         if (!toolEvent)
  83.             toolEvent = CTermPane::cTestToolEvent(macEvent,theWindow);
  84.     }
  85.     
  86.     if (!toolEvent)
  87.         inherited::DispatchEvent(macEvent);    /* Send the evt to its superclass */
  88. }
  89.  
  90.  
  91. /* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ */